package com.jiankang.askhealth.core.api.base;

import com.jiankang.askhealth.util.ApiErrorMsgUtil;

public class ApiResult {

    private boolean success;
    private int errorCode;
    private String errorMsg;

    public ApiResult() {
    }

    public ApiResult(boolean success) {
        this.success = success;
    }

    public ApiResult(int errorCode) {
        this(errorCode, ApiErrorMsgUtil.getErrorMsg(errorCode));
    }

    public ApiResult(int errorCode, String errorMsg) {
        this.success = false;
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

    public boolean isSuccess() {
        return success;
    }
    public void setSuccess(boolean success) {
        this.success = success;
    }

    public int getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(int errorCode) {
        this.errorCode = errorCode;
    }

    public String getErrorMsg() {
        return errorMsg;
    }
    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }
}
